<template>
  <div>
    <h2>父组件</h2>
    <!-- 传递布尔类型的flag值给子组件 -->
    <child-component :flag="isFlag" @update="isFlag = $event"></child-component>
  </div>
</template>

<script>
import ChildComponent from './Child.vue'
export default {
  name: 'FatherDemo',
  components: {
    ChildComponent
  },
  data() {
    return {
      isFlag: false
    }
  },
  created() {
    this.isFlag = true
  }
}
</script>
